<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="按钮" onclick="f1()">

<script>
  /*第一种定义方法方式*/
  /*无参无返回值*/
  function f1() {
    console.log("我爱你中国！");
    console.log("我爱你中国！");
    console.log("我爱你中国！");
  }
  f1();
  /*有参无返回值*/
  function f2(name,age) {
    console.log(name+":"+age);
  }
  f2("小花",18);
  /*无参有返回值*/
  function f3() {
    return "但是妈妈！我弄丢一切吗？";
  }
  let info1 = f3();
  console.log(info1);
  /*有参有返回值*/
  function f4(name,age) {
    return name+":"+age;
  }
  let info2 = f4("小海",23);
  console.log(info2);

  /*第二种*/
  let f5 = function (name,age) {
    console.log(name+":"+age);
  }
  f5("康康",22);
  let f6 = function () {
    return "是我给你自由过了火";
  }
  let info3 = f6();
  console.log(info3);

  /*第三种*/
  let f7 = new Function("x","y","console.log(x*y)");
  f7(3,4);

</script>
</body>
</html>